package cn.tedu.boot.ers.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;


@Data
public class AddProductDTO {

    @NotNull(message = "商品名称不能为null")
    private String title;

    @NotNull(message = "商品图片不能为null")
    @ApiModelProperty(value = "图片地址",example = "图片存放地址")
    private String url;

    @NotNull(message = "商品价格不能为null")
    @Min(value = 0,message = "价格不能小于0")
    private BigDecimal price;

    @ApiModelProperty(value = "是否启用", required = true,example = "0未启用,1启用")
    private String isEnable;

    @NotNull(message = "商品分类不能为null")
    private Long productTypeId;

    @NotNull(message = "商品销售量不能为null")
    @Min(value = 0,message = "销售量不能小于0")
    private Long sale;

    private String description;
}
